<template>
  <p>
    {{ id }}
  </p>
</template>

<script setup>

import axios from 'axios'
import { onMounted, ref } from 'vue'

const id = ref()

const test = async () => {
  await axios.get('/test')
    .then(res => {
      console.log(res)
      id.value = res.data.data.id
    })
  console.log(id)
}

onMounted(async () => {
  test()
})

</script>

<style>

</style>
